<?php declare(strict_types=1);


namespace App\Rpc\Model\Entity;

use Swoft\Db\Annotation\Mapping\Column;
use Swoft\Db\Annotation\Mapping\Entity;
use Swoft\Db\Annotation\Mapping\Id;
use Swoft\Db\Eloquent\Model;


/**
 * 租户-工作人员-账号表
 * Class UserConsigner
 *
 * @since 2.0
 *
 * @Entity(table="user_consigner")
 */
class UserConsigner extends Model
{
    /**
     * 主键id
     * @Id()
     * @Column()
     *
     * @var int
     */
    private $id;

    /**
     * 数据唯一ID
     *
     * @Column(name="item_id", prop="itemId")
     *
     * @var string
     */
    private $itemId;

    /**
     * 登录账号
     *
     * @Column()
     *
     * @var string
     */
    private $account;

    /**
     * 登录密码
     *
     * @Column()
     *
     * @var string
     */
    private $password;

    /**
     * 支付密码： 默认为123456
     *
     * @Column(name="pay_password", prop="payPassword")
     *
     * @var string
     */
    private $payPassword;

    /**
     * 密码盐匙
     *
     * @Column()
     *
     * @var string
     */
    private $salt;

    /**
     * 货主item_id
     *
     * @Column(name="consigner_id", prop="consignerId")
     *
     * @var string|null
     */
    private $consignerId;

    /**
     * 签发token
     *
     * @Column()
     *
     * @var string|null
     */
    private $token;

    /**
     * 微信open_id
     *
     * @Column(name="open_id", prop="openId")
     *
     * @var string|null
     */
    private $openId;

    /**
     * 微信union_id
     *
     * @Column(name="union_id", prop="unionId")
     *
     * @var string|null
     */
    private $unionId;

    /**
     * 最近一次登录ip
     *
     * @Column(name="last_login_ip", prop="lastLoginIp")
     *
     * @var string|null
     */
    private $lastLoginIp;

    /**
     * 最近一次登录时间
     *
     * @Column(name="last_login_time", prop="lastLoginTime")
     *
     * @var int|null
     */
    private $lastLoginTime;

    /**
     * 登陆次数： 初始为0
     *
     * @Column(name="login_times", prop="loginTimes")
     *
     * @var int
     */
    private $loginTimes;

    /**
     * 是否冻结：0未冻结 1已冻结
     *
     * @Column(name="frozen_state", prop="frozenState")
     *
     * @var int|null
     */
    private $frozenState;

    /**
     * 创建时间 int
     *
     * @Column(name="created_at", prop="createdAt")
     *
     * @var int
     */
    private $createdAt;

    /**
     * 更新时间 int
     *
     * @Column(name="updated_at", prop="updatedAt")
     *
     * @var int|null
     */
    private $updatedAt;


    /**
     * @param int $id
     *
     * @return self
     */
    public function setId(int $id): self
    {
        $this->id = $id;

        return $this;
    }

    /**
     * @param string $itemId
     *
     * @return self
     */
    public function setItemId(string $itemId): self
    {
        $this->itemId = $itemId;

        return $this;
    }

    /**
     * @param string $account
     *
     * @return self
     */
    public function setAccount(string $account): self
    {
        $this->account = $account;

        return $this;
    }

    /**
     * @param string $password
     *
     * @return self
     */
    public function setPassword(string $password): self
    {
        $this->password = $password;

        return $this;
    }

    /**
     * @param string $payPassword
     *
     * @return self
     */
    public function setPayPassword(string $payPassword): self
    {
        $this->payPassword = $payPassword;

        return $this;
    }

    /**
     * @param string $salt
     *
     * @return self
     */
    public function setSalt(string $salt): self
    {
        $this->salt = $salt;

        return $this;
    }

    /**
     * @param string|null $consignerId
     *
     * @return self
     */
    public function setConsignerId(?string $consignerId): self
    {
        $this->consignerId = $consignerId;

        return $this;
    }

    /**
     * @param string|null $token
     *
     * @return self
     */
    public function setToken(?string $token): self
    {
        $this->token = $token;

        return $this;
    }

    /**
     * @param string|null $openId
     *
     * @return self
     */
    public function setOpenId(?string $openId): self
    {
        $this->openId = $openId;

        return $this;
    }

    /**
     * @param string|null $unionId
     *
     * @return self
     */
    public function setUnionId(?string $unionId): self
    {
        $this->unionId = $unionId;

        return $this;
    }

    /**
     * @param string|null $lastLoginIp
     *
     * @return self
     */
    public function setLastLoginIp(?string $lastLoginIp): self
    {
        $this->lastLoginIp = $lastLoginIp;

        return $this;
    }

    /**
     * @param int|null $lastLoginTime
     *
     * @return self
     */
    public function setLastLoginTime(?int $lastLoginTime): self
    {
        $this->lastLoginTime = $lastLoginTime;

        return $this;
    }

    /**
     * @param int $loginTimes
     *
     * @return self
     */
    public function setLoginTimes(int $loginTimes): self
    {
        $this->loginTimes = $loginTimes;

        return $this;
    }

    /**
     * @param int|null $frozenState
     *
     * @return self
     */
    public function setFrozenState(?int $frozenState): self
    {
        $this->frozenState = $frozenState;

        return $this;
    }

    /**
     * @param int $createdAt
     *
     * @return self
     */
    public function setCreatedAt(int $createdAt): self
    {
        $this->createdAt = $createdAt;

        return $this;
    }

    /**
     * @param int|null $updatedAt
     *
     * @return self
     */
    public function setUpdatedAt(?int $updatedAt): self
    {
        $this->updatedAt = $updatedAt;

        return $this;
    }

    /**
     * @return int
     */
    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * @return string
     */
    public function getItemId(): ?string
    {
        return $this->itemId;
    }

    /**
     * @return string
     */
    public function getAccount(): ?string
    {
        return $this->account;
    }

    /**
     * @return string
     */
    public function getPassword(): ?string
    {
        return $this->password;
    }

    /**
     * @return string
     */
    public function getPayPassword(): ?string
    {
        return $this->payPassword;
    }

    /**
     * @return string
     */
    public function getSalt(): ?string
    {
        return $this->salt;
    }

    /**
     * @return string|null
     */
    public function getConsignerId(): ?string
    {
        return $this->consignerId;
    }

    /**
     * @return string|null
     */
    public function getToken(): ?string
    {
        return $this->token;
    }

    /**
     * @return string|null
     */
    public function getOpenId(): ?string
    {
        return $this->openId;
    }

    /**
     * @return string|null
     */
    public function getUnionId(): ?string
    {
        return $this->unionId;
    }

    /**
     * @return string|null
     */
    public function getLastLoginIp(): ?string
    {
        return $this->lastLoginIp;
    }

    /**
     * @return int|null
     */
    public function getLastLoginTime(): ?int
    {
        return $this->lastLoginTime;
    }

    /**
     * @return int
     */
    public function getLoginTimes(): ?int
    {
        return $this->loginTimes;
    }

    /**
     * @return int|null
     */
    public function getFrozenState(): ?int
    {
        return $this->frozenState;
    }

    /**
     * @return int
     */
    public function getCreatedAt(): ?int
    {
        return $this->createdAt;
    }

    /**
     * @return int|null
     */
    public function getUpdatedAt(): ?int
    {
        return $this->updatedAt;
    }

}
